home *** CD-ROM | disk | FTP | other *** search
- /* AREXX SCRIPT log.rexx
-
- Stores all boot up times (including after a '3 fingers salute', and after
- a guru) and shut down times to file 'logonpath'/BootLogFile.
- ***(WITH a bit of YOUR HELP ;-)***
-
- ie: file Temp:logon/BootLogFile may contain:
- ...
- Sa_26-Sep_09:12 - Power up time.
- Sa_26-Sep_13:45 - Guru: culprit not known!
- ...
- SA_26-Sep_15:28 - Reset: this silly ***** program hung again!!
- Sa_26-Sep_23:58 - Shut down time.
- ----------------------------------
- Su_27-Sep_08:23 - Power up time.
-
- Dont forget to put "rx log on" near the end of your startup-sequence,
- and AFTER "rexxmast" and IPrefs ;-), and to edit the 'starred' line below!
-
- call 'rx log off' before shutting down the system.
-
- written 26-Sep-92 Gérard Cornu
-
-
- Change the part of the following line to the PATH (without the filename),
- where you want your logon file to be. /
- \ /
- \_______ ___________________________________________/
- \ THIS PART ONLY /
- \ / */
- logonpath = "temp:logon/" /* <---- edit here ************************
- ^
- |
- don't forget the / or :
- ~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
- arg switch
-
- logonfile = "BootLogFile"
-
- hil = ""
- nor = ""
-
- option results
-
- day = left(date('weekday'),2)
- date = left(space(date(), 1, '-'), 6)
- time = left(time(), 5)
- datetime = day||'_'||date||'_'||time
-
- if switch = 'ON' then do
- say "c" /* clear screen */
- query = getbootup()
- end
- else if switch = 'OFF' then do
- query = " - Shut down time."
- end
-
- if(~exists(logonpath||logonfile)) then
- mode = 'W'
- else mode = "A"
-
- if ~open(datefile, logonpath||logonfile,mode) then do
- say ""
- say "Could not open "||logonpath||logonfile|| "...aborting."
- say ""
- exit 20
- end
-
- if mode = "W" then do
- writeln(datefile, " *** Log file created by log.rexx ***")
- writeln(datefile, " *** written by Gérard Cornu (26-Sep-92) ***")
- writeln(datefile, "")
- end
-
- writeln(datefile, datetime||query)
- if switch = 'OFF' then do
- writeln(datefile, "----------------------------------")
- end
-
- close(datefile)
-
- say "c"
-
- exit 0
-
- /*--------------------------------- E N D --------------------------------*/
-
- /*--------------------------- getbootup()----------------------------*/
- getbootup:
-
- say "c"
- say ""
- say " As you probably know (;-), your system is now booting-up!"
- say " And I've been assigned the task of keeping a log file of"
- say " this process, so I would be much grateful if you can help"
- say " me by giving me some info."
- say ""
- say " What is this boot-up due to:"
- say ""
- say hil||" N"||nor||" - Normal power-up"
- say
- say hil||" R"||nor||" - Reset (ctrl-Amiga-Amiga)"
- say
- say hil||" G"||nor||" - Guru"
- say
- say hil||" C"||nor||" - Power cut"
- say
- say hil||" V"||nor||" - Fear of virus"
- say
- say
- say
-
- bootup = ""
-
- do while ((bootup ~= "N") ^ (bootup ~= "C") ^ (bootup ~= "V"),
- ^ (bootup ~= "G") ^ (bootup ~= "R"))
- say ""
- writech(stdout, "AA Please enter "||hil||"n"||nor||", "||hil||"r"||nor,
- ", "||hil||"g"||nor", "||hil||"c"||nor||" or "||hil||"v"||nor||" ? ")
- pull bootup
- end
-
- select
- when bootup = "N" then query = " - Power up time."
- when bootup = "C" then query = " - Power cut: "
- when bootup = "V" then query = " - Fear of virus: "
- when bootup = "G" then query = " - Guru: "
- when bootup = "R" then query = " - Reset: "
- otherwise exit(20)
- end
-
- if bootup = "C" | bootup = "V" | bootup = 'G' | bootup = 'R' then do
- query = query||getmoreinfo(query)
- end
- return query
-
- /*------------------------ getmoreinfo() ------------------------------*/
- getmoreinfo:
-
- arg item
-
- say
- say
- say " Please give me more info about this "||item
- writech(stdout, " or just [enter] if none ? ")
-
- parse pull moreinfo
-
- if moreinfo = "" then moreinfo = "???"
-
- return moreinfo
- /*------------------------------------------------------------------*/
-
-